/** 冒泡排序 */
export function sort(src, cb) {
  if (!(cb instanceof Function)) {
    return src
  }
  for (let i = 0; i < src.length; i++) {
    for (let j = i; j < src.length; j++) {
      if (cb(src[i], src[j])) {
        const t = src[i]
        src[i] = src[j]
        src[j] = t
      }
    }
  }
  return src
}
